﻿#define _CRT_SECURE_NO_WARNINGS//竞选社长
#include<stdio.h>
int main()
{
	int  c = 0;
	int count_a = 0;
	int count_b = 0;
	while (c = getchar())
	{
		if (c == 'A')
			count_a++;
		if (c == 'B')
			count_b++;
		if (c == '0')
			break;
	}
	if (count_a > count_b)
		printf("A");
	if (count_a < count_b)
		printf("B");
	if (count_a == count_b)
		printf("E");
	return 0;
}